<?php

namespace model;

/**
 *Model opisujący obrazek
 *
 * @author Damian
 */
class TblPicture extends Model{
    /**
     * @readwrite
     * @column
     * @primary
     * @type int
     * @length 11
     */
    public $PictureID;
    const ID="PictureID";
    /**
     * @readwrite
     * @column
     * @type varchar
     * @length 255
     */
    public $Name;
    const NAME="Name";
    /**
     * @readwrite
     * @column
     * @type varchar
     * @length 32
     */
    public $Mime;
    const MIME="Mime";
    /**
     * @readwrite
     * @column
     * @type boolean
     */
    public $Deleted;
    const DELETED="Deleted";
    /**
     * @readwrite
     */
    public $Created;
    const CREATED="Created";
     /**
     * @readwrite
     */
    public $Modified;
    const MODIFIED="Modified";
    /**
     * @readwrite
     */
    public $ShopID;
    const SHOP_ID="ShopID";
    /**
     * <p>sprawdza czy dany element jest w danym sklepie</p>
     * @param \model\TblShop $shop <p>sklep do sprawdzenia</p>
     * @return boolean
     */
    public function compare(TblSeller &$Seller){
        $myseller = TblSeller::getModel()->getByPrimaryKey($this->SellerID);
        if (!$myseller)  {
            return false;
        }
        return $myseller->SellerID==$Seller->SellerID;
    }
}
